module(
    name = "rules_diff",
    version = "1.0.0-beta.6",
    bazel_compatibility = [
        ">=7.1.0",
    ],
    compatibility_level = 1,
)

bazel_dep(name = "toolchain_utils", version = "1.0.0-beta.18")
bazel_dep(name = "ape", version = "1.0.0-beta.15")

export = use_extension("@toolchain_utils//toolchain/export:defs.bzl", "toolchain_export")

resolved = use_repo_rule("@toolchain_utils//toolchain/resolved:defs.bzl", "toolchain_resolved")

[
    (
        use_repo(export, "ape-{}".format(tool)),
        export.symlink(
            name = tool,
            target = "@ape-{}".format(tool),
        ),
        use_repo(export, tool),
        resolved(
            name = "resolved-{}".format(tool),
            toolchain_type = "//diff/toolchain/{}:type".format(tool),
        ),
    )
    for tool in ("diff", "diff3", "sdiff", "cmp")
]

register_toolchains("//diff/toolchain/...")
